package org.dandelion.command
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	import mx.resources.IResourceManager;
	import mx.resources.ResourceManager;
	
	import org.dandelion.core.message.IMessageService;
	import org.dandelion.core.message.MessageService;
	import org.dandelion.core.remote.IRemoteService;
	import org.dandelion.core.remote.RemoteService;
	
	public class DandelionController extends EventDispatcher
	{
		public function DandelionController(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		private var _remoteService:IRemoteService;
		/**
		 * 远程代理 AMF通信 RemoteService
		 * */
		public function get remoteService():IRemoteService{
			if(!_remoteService){
				_remoteService = RemoteService.getInstance();
			}
			return _remoteService;
		}
		
		private var _messageService:IMessageService;
		/**
		 * 消息订阅服务 MessageService
		 * */
		public function get messageService():IMessageService{
			if(!_messageService){
				_messageService = MessageService.instance();
			}
			return _messageService;
		}
		
		
		private var _resourceManager:IResourceManager = ResourceManager.getInstance();
		/**
		 * 获取 IResourceManager 实现的单一实例。IResourceManager 和 IResourceBundle 接口共同为 Flex 
		 * 应用程序提供国际化支持。 
		 * */
		public function get resourceManager():IResourceManager{
			return _resourceManager;
		}
	}
}